﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace BattleShips.Common {
    public class Response {
        public string CommandName { get; set; }
        public int Code { get; set; }
        public string Payload { get; set; }

        public override string ToString() {
            if (Payload == null) {
                return string.Format("@<{0}:{1}>;", CommandName, Code);
            } else {
                return string.Format("@<{0}:{1}> {2};", CommandName, Code, Payload);
            }
        }
    }
}
